using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DragonAwakening.Game
{
    /// <summary>
    /// 
    /// </summary>
    public enum Sides : int
    {
        North = 0,
        South = 1,
        East = 2, 
        West = 3,
        Floor = 4,
        Sky = 5
    }

    /// <summary>
    /// Map cell class.
    /// </summary>
    public class MapCell
    {
        /// <summary>
        /// Walls information
        /// </summary>
        private short[] Walls = new short[6];

        /// <summary>
        /// Constructs new map cell.
        /// </summary>
        public MapCell(int x, int y, short wallNorth, short wallSouth, short wallEast, short wallWest, short floor, short sky)
        {
            this.X = x;
            this.Y = y;
            this.Walls[0] = wallNorth;
            this.Walls[1] = wallSouth;
            this.Walls[2] = wallEast;
            this.Walls[3] = wallWest;
            this.Walls[4] = floor;
            this.Walls[5] = sky;
        }

        /// <summary>
        /// X coordinate of the map.
        /// </summary>
        public int X { get; set; }
        
        /// <summary>
        /// Y coordinate of the map.
        /// </summary>
        public int Y { get; set; }

        /// <summary>
        /// Gets the map cell information.
        /// </summary>
        public short GetWall(Sides side)
        {
            switch (side)
            { 
                case Sides.North:
                    return this.Walls[0];
                case Sides.South:
                    return this.Walls[1];
                case Sides.East:
                    return this.Walls[2];
                case Sides.West:
                    return this.Walls[3];
                case Sides.Floor:
                    return this.Walls[4];
                case Sides.Sky:
                    return this.Walls[5];
            }

            return -1;
        }
    }
}
